home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / t_unix / j109lxa4.tar / mailbox.h < prev    next >
C/C++ Source or Header  |  1994-06-04  |  8KB  |  187 lines

  1. #ifndef _MAILBOX_H
  2. #define _MAILBOX_H
  3. /* Defines for the ax.25 mailbox facility */
  4. #define NUMMBX          10              /* max number of mailbox sessions */
  5. #ifndef _TIMER_H
  6. #include "timer.h"
  7. #endif
  8. #ifndef _AX25_h
  9. #include "ax25.h"
  10. #endif
  11. #ifndef _CONFIG_H
  12. #include "config.h"
  13. #endif
  14. #ifndef _TIPMAIL_H
  15. #include "tipmail.h"
  16. #endif
  17.  
  18.  
  19. /* a mailbox entry */
  20. struct let {
  21.     long    start;
  22.     long    size;
  23.     int     status;
  24. };
  25.  
  26. #define MAXPWDLEN 30
  27. #define MBXLINE     128     /* max length of line */
  28. #define MBXNAME 20          /* max length of user name */
  29. #define CNAMELEN 10         /* max lenght of convers names */
  30.  
  31. struct mbx {
  32.     struct mbx *next;       /* next one on list */
  33.     int state ;             /* mailbox state */
  34. #define MBX_LOGIN       0               /* trying to log in */
  35. #define MBX_CMD         1               /* in command mode */
  36. #define MBX_SUBJ        2               /* waiting for a subject line */
  37. #define MBX_DATA        3               /* collecting the message */
  38. #define MBX_REVFWD      4               /* reverse forwarding in progress */
  39. #define MBX_TRYING      5               /* pending forwarding connection */
  40. #define MBX_FORWARD     6               /* established forwarding connection */
  41. #define MBX_GATEWAY 7       /* gatewaying somewhere */
  42. #define MBX_READ    8       /* reading a message */
  43. #define MBX_UPLOAD  9       /* uploading a file */
  44. #define MBX_DOWNLOAD 10     /* downloading a file */
  45. #define MBX_CONVERS 11      /* Using convers mode */
  46. #define MBX_CHAT    12      /* Chatting with sysop */
  47. #define MBX_WHAT    13      /* Listing files */
  48. #define MBX_SYSOPTRY 14     /* Trying sysop */
  49. #define MBX_SYSOP   15      /* Is sysop */
  50. #define MBX_XMODEM_RX 16    /* receiving xmodem */
  51. #define MBX_XMODEM_TX 17    /* sending xmodem */
  52.     int family;             /* Type of incoming connection */
  53.     char name[20] ;         /* Name of remote station */
  54.     char call[AXALEN];      /* User call in shifted form, if applicable*/
  55.     long last;              /* Time of last login */
  56.     char *to ;          /* To-address in form user or user@host */
  57.     char *origto ;                  /* Original To-address, if rewritten */
  58.     char *tofrom ;                  /* Optional <from in to-address */
  59.     char *origbbs ;         /* Original bbs, if tracing R: lines */
  60.     char *tomsgid ;         /* Optional $msgid in to-address */
  61.     char *subject ;         /* Message subject */
  62.     char *date ;            /* Date of the message */
  63.     FILE *tfile ;           /* Temporary file for message, or */
  64.                     /* forwarding file. */
  65.     FILE *tfp;              /* Temporary file when reading R: headers */
  66.     char line[MBXLINE+1] ;  /* Room for null at end */
  67.     int sid ;               /* Characteristics indicated by the SID */
  68.                 /* banner of the attaching station.  If */
  69.                 /* no SID was sent, this is zero.  If an */
  70.                 /* SID of any kind was received, it is */
  71.                 /* assumed that the station supports */
  72.                 /* abbreviated mail forwarding mode. */
  73. #define MBX_SID         0x01    /* Got any SID */
  74. #define MBX_RLI_SID     0x02    /* This is an RLI BBS, disconnect after F> */
  75. #define MBX_HIER_SID    0x04    /* The BBS supports hierarchical routing */
  76. #define MBX_EXPERT  0x08        /* expert user status */
  77. #define MBX_AREA    0x10        /* show area in prompt */
  78. #define MBX_NRID    0x20        /* use netrom ident */
  79. #define MBX_LL      0x80        /* LAN-LINK system */
  80. #define MBX_MID     0x0100      /* BBS supports MID's */
  81. #define MBX_FBB     0x0200      /* F6FBB bbs */
  82.     char stype ;        /* BBS send command type (B,P,T, etc.) */
  83.     int type ;              /* Type of session when invoking "chat" */
  84.     int user;               /* User linkage area */
  85.     char escape;            /* Escape character */
  86.     long privs;      /* Privileges (taken from Ftpusers file) */
  87. #define AX25_CMD        8       /* AX.25 gateway operation allowed */
  88. #define TELNET_CMD      16      /* Telnet gateway operation allowed */
  89. #define NETROM_CMD      32      /* NET/ROM gateway operation allowed */
  90. #define SYSOP_CMD       64      /* Remote sysop access allowed */
  91. #define EXCLUDED_CMD    128     /* This user is banned from the BBS */
  92. /* 256 and 512 are used in PPP*/
  93. #define NO_SENDCMD  1024    /* Disallow send command */
  94. #define NO_READCMD  2048    /* Disallow read command */
  95. #define NO_3PARTY   4096    /* Disallow third-party mail */
  96. #define IS_BBS      8192    /* This user is a bbs */
  97. #define IS_EXPERT   16384   /* This user is an expert */
  98. #define NO_CONVERS  32768   /* Disallow convers command */
  99. #define NO_ESCAPE   65536   /* Default is no escape */
  100.  
  101.     char *path;     /* Directory path */
  102.     char *startmsg;     /* Message to be sent at connect through any
  103.              * of the gateways */
  104.     int current;        /* the current message number */
  105.     int nmsgs;              /* number of messages in this mail box */
  106.     int newmsgs;            /* number of new messages in mail box */
  107.     int change;             /* mail file changed */
  108.     int anyread;            /* true if any message has been read */
  109.     FILE *mfile;            /* mail data file pointer */
  110.     char area[64];          /* name of current mail area */
  111.     int isarea;         /* is the current mail area private or public ? */
  112.     int morerows;       /* Number of lines before -more- prompt */
  113. /* Next two are used by userlog code - WG7J */
  114.     long lastread;          /* number of last read message in area */
  115.     long newlastread;   /* id of new last listed message in area */
  116.     long mboxsize;          /* size of mailbox when opened */
  117.     long mysize;            /* size of my private mailbox */
  118.     struct let *mbox;
  119.     struct timer tdisc; /* Inactivity timeout timer - WG7J */
  120.     char *stdinbuf;         /* the stdio buffer for the mail file */
  121.     char *stdoutbuf;        /* the stdio file io buffer for the temp file */
  122. #ifdef TIPMAIL
  123.     struct tipcb *tip;       /* tip structure if tip mail incoming */
  124. #endif
  125.     int linemode;
  126. } ;
  127. #define         NULLMBX         (struct mbx *)0
  128.  
  129. /* Structure used for automatic flushing of gateway sockets */
  130. struct gwalarm {
  131.     int s1;
  132.     int s2;
  133.     struct timer t;
  134. };
  135.  
  136. /* In converse.c */
  137. extern void mbox_converse(struct mbx *);
  138. extern int ShowConfLinks __ARGS((int s,int full));
  139. extern int ShowConfUsers __ARGS((int s,int quick));
  140.  
  141. /* In mailbox.c */
  142. extern struct mbx *Mbox;
  143. extern char Noperm[];
  144. extern char Nosock[];
  145. extern void (*Listusers) __ARGS((int s));
  146. extern int ThirdParty;
  147. extern int Mtrace;
  148.  
  149. int dombescape __ARGS((int argc,char *argv[],void *p));
  150. int mbxrecvline __ARGS((struct mbx *m));
  151. int gw_connect __ARGS((struct mbx *m,int s,struct sockaddr *fsocket,int len));
  152.  
  153. void mbx_incom __ARGS((int s,void *t,void *p));
  154. int domboxdisplay __ARGS((int argc,char *argv[],void *p));
  155. struct mbx *newmbx __ARGS((void));
  156. void exitbbs __ARGS((struct mbx *m));
  157. int domboxbye __ARGS((int argc,char *argv[],void *p));
  158. int mbx_parse __ARGS((struct mbx *m));
  159. void changearea __ARGS((struct mbx *m,char *area));
  160. char *rewrite_address __ARGS((char *addr));
  161. void listusers __ARGS((int s));
  162. void putprompt __ARGS((struct mbx *m));
  163. int doxmodem __ARGS((char mode,char *filename,void *p));
  164. int uuencode __ARGS((FILE *infile,int s,char *infilename));
  165. int dombtelnet __ARGS((int argc,char *argv[],void *p));
  166. int dombports __ARGS((int argc,char *argv[],void *p));
  167.  
  168. /* in mboxcmd.c */
  169. extern char Mbnrid[];
  170. int dombuserinfo __ARGS((int argc,char *argv[],void *p));
  171. void loguser __ARGS((struct mbx *m));
  172. void setmbnrid __ARGS((void));
  173. void listnewmail(struct mbx *m);
  174.  
  175.  
  176.  
  177. /* In forward.c: */
  178. int dorevfwd __ARGS((int argc,char *argv[],void *p));
  179. int dombtimer __ARGS((int argc,char *argv[],void *p));
  180. int dombkick __ARGS((int argc,char *argv[],void *p));
  181.  
  182. /* In tipmail.c */
  183. extern unsigned Tiptimeout;
  184.  
  185. #endif  /* _MAILBOX_H */
  186.  
  187.